<!DOCTYPE html>

<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<title>messageformat Class: Messages</title>

	<!--[if lt IE 9]>
	<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.flatly.css">

	<link rel='apple-touch-icon' sizes='180x180' href='logo/favicon-180.png'>
<link rel='icon' type='image/png' sizes='32x32' href='logo/favicon-32.png'>
</head>

<body>

<div class="navbar navbar-default navbar-fixed-top ">
<div class="container">
	<div class="navbar-header">
		<a class="navbar-brand" href="./"><img class="branding-logo" src="logo/messageformat.svg"
		alt="logo"/>messageformat</a>
		<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
        </button>
	</div>
	<div class="navbar-collapse collapse" id="topNavigation">
		<ul class="nav navbar-nav">
			
			<li class="dropdown">
				<a href="classes.list" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="Formatters">Formatters</a></li><li><a href="MessageFormat">MessageFormat</a></li><li><a href="Messages">Messages</a></li>
				</ul>
			</li>
			
				
					<li class="nav-item">
						<a class="nav-link" href="page-about">About</a>
					</li>
				
					<li class="nav-item">
						<a class="nav-link" href="page-build">Usage</a>
					</li>
				
					<li class="nav-item">
						<a class="nav-link" href="page-guide">Format Guide</a>
					</li>
				
			
		</ul>
        
        
          <ul class="nav navbar-nav navbar-right">
            
              <li><a href="https://github.com/messageformat/messageformat/releases">2.2.1</a></li>
            
            <li class="navbar-github-icon"><a href="https://github.com/messageformat/messageformat">
              <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <title>messageformat on GitHub</title>
                <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
              </svg>
            </a></li>
          </ul>
        
	</div>

</div>
</div>


<div class="container" id="toc-content">
<div class="row">

	
	<div class="col-md-8">
	
		<div id="main">
			

	<h1 class="page-title">Class: Messages</h1>
<section>

<header>
    
        
            <hr>
            <div class="class-description"><p>Accessor for compiled MessageFormat functions</p>
<pre class="prettyprint source"><code>import Messages from 'messageformat/messages'
</code></pre></div>
        
    
</header>


<article>
    <div class="container-overview">
    
        

<hr>
<dt>
    <h4 class="name" id="Messages"><span class="type-signature"></span>new Messages(locales [, defaultLocale])</h4>
    
    
</dt>

<dd>

    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>locales</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>A map of locale codes to their function objects</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>defaultLocale</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">null</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>If not defined, default and initial locale is the first entry of <code>locales</code></p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    

    
        <h5>Example</h5>
        
    <pre class="sunlight-highlight-javascript">var fs = require(&#x27;fs&#x27;);
var MessageFormat = require(&#x27;messageformat&#x27;);
var mf = new MessageFormat([&#x27;en&#x27;, &#x27;fi&#x27;]);
var msgSet = {
  en: {
    a: &#x27;A {TYPE} example.&#x27;,
    b: &#x27;This has {COUNT, plural, one{one user} other{# users}}.&#x27;,
    c: {
      d: &#x27;We have {P, number, percent} code coverage.&#x27;
    }
  },
  fi: {
    b: &#x27;Tällä on {COUNT, plural, one{yksi käyttäjä} other{# käyttäjää}}.&#x27;,
    e: &#x27;Minä puhun vain suomea.&#x27;
  }
};
var cfStr = mf.compile(msgSet).toString(&#x27;module.exports&#x27;);
fs.writeFileSync(&#x27;messages.js&#x27;, cfStr);

...

var Messages = require(&#x27;messageformat/messages&#x27;);
var msgData = require(&#x27;./messages&#x27;);
var messages = new Messages(msgData, &#x27;en&#x27;);

messages.hasMessage(&#x27;a&#x27;)                // true
messages.hasObject(&#x27;c&#x27;)                 // true
messages.get(&#x27;b&#x27;, { COUNT: 3 })         // &#x27;This has 3 users.&#x27;
messages.get([&#x27;c&#x27;, &#x27;d&#x27;], { P: 0.314 })  // &#x27;We have 31% code coverage.&#x27;

messages.get(&#x27;e&#x27;)                       // &#x27;e&#x27;
messages.setFallback(&#x27;en&#x27;, [&#x27;foo&#x27;, &#x27;fi&#x27;])
messages.get(&#x27;e&#x27;)                       // &#x27;Minä puhun vain suomea.&#x27;

messages.locale = &#x27;fi&#x27;
messages.hasMessage(&#x27;a&#x27;)                // false
messages.hasMessage(&#x27;a&#x27;, &#x27;en&#x27;)          // true
messages.hasMessage(&#x27;a&#x27;, null, true)    // true
messages.hasObject(&#x27;c&#x27;)                 // false
messages.get(&#x27;b&#x27;, { COUNT: 3 })         // &#x27;Tällä on 3 käyttäjää.&#x27;
messages.get(&#x27;c&#x27;).d({ P: 0.628 })       // &#x27;We have 63% code coverage.&#x27;</pre>


    
</dd>

    
    </div>

    

    

    

    

    

    
        <h3 class="subsection-title">Members</h3>

        <dl>
            
<hr>
<dt class="name" id=".availableLocales">
    <h4 id=".availableLocales"><span class="type-signature">&lt;static, readonly> </span>availableLocales<span class="type-signature"> :Array.&lt;string></span></h4>

    
</dt>
<dd>
    
    <div class="description">
        <p>List of available locales</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">Array.&lt;string></span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    
</dd>

        
            
<hr>
<dt class="name" id=".defaultLocale">
    <h4 id=".defaultLocale"><span class="type-signature">&lt;static> </span>defaultLocale<span class="type-signature"> :string|null</span></h4>

    
</dt>
<dd>
    
    <div class="description">
        <p>Default fallback locale</p>
<p>One of Messages#availableLocales or <code>null</code>. Partial matches of language tags
are supported, so e.g. with an <code>en</code> locale defined, it will be selected by
<code>messages.defaultLocale = 'en-US'</code> and vice versa.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">string</span>
|

<span class="param-type">null</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    
</dd>

        
            
<hr>
<dt class="name" id=".locale">
    <h4 id=".locale"><span class="type-signature">&lt;static> </span>locale<span class="type-signature"> :string|null</span></h4>

    
</dt>
<dd>
    
    <div class="description">
        <p>Current locale</p>
<p>One of Messages#availableLocales or <code>null</code>. Partial matches of language tags
are supported, so e.g. with an <code>en</code> locale defined, it will be selected by
<code>messages.locale = 'en-US'</code> and vice versa.</p>
    </div>
    

    
        <h5>Type:</h5>
        <ul>
            <li>
                
<span class="param-type">string</span>
|

<span class="param-type">null</span>



            </li>
        </ul>
    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    
</dd>

        </dl>
    

    
        <h3 class="subsection-title">Methods</h3>

        <dl>
            

<hr>
<dt>
    <h4 class="name" id="addMessages"><span class="type-signature"></span>addMessages(data [, lc] [, keypath])</h4>
    
    
</dt>

<dd>

    
    <div class="description">
        <p>Add new messages to the accessor; useful if loading data dynamically</p>
<p>The locale code <code>lc</code> should be an exact match for the locale being updated,
or empty to default to the current locale. Use #resolveLocale for
resolving partial locale strings.</p>
<p>If <code>keypath</code> is empty, adds or sets the complete message object for the
corresponding locale. If any keys in <code>keypath</code> do not exist, a new object
will be created at that key.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>data</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>
|

<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>Hierarchical map of keys to functions, or a
single message function</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>If empty or undefined, defaults to <code>this.locale</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>keypath</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;string></span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>The keypath being added</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Messages instance, to allow for chaining</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Messages">Messages</a></span>



    </dd>
</dl>


        

    
</dd>

        
            

<hr>
<dt>
    <h4 class="name" id="get"><span class="type-signature"></span>get(key [, props] [, lc])</h4>
    
    
</dt>

<dd>

    
    <div class="description">
        <p>Get the message or object corresponding to <code>key</code></p>
<p><code>key</code> may be a <code>string</code> for functions at the root level, or <code>string[]</code> for
accessing hierarchical objects. If an exact match is not found, the fallback
locales are checked for the first match.</p>
<p>If <code>key</code> maps to a message function, it will be called with <code>props</code>. If it
maps to an object, the object is returned directly.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last"><p>The key or keypath being sought</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>props</code></td>
            

            <td class="type">
            
                
<span class="param-type">object</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>Optional properties passed to the function</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>If empty or undefined, defaults to <code>this.locale</code></p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>
|

<span class="param-type">Object.&lt;string, (function()|object)></span>



    </dd>
</dl>


        

    
</dd>

        
            

<hr>
<dt>
    <h4 class="name" id="getFallback"><span class="type-signature"></span>getFallback( [lc])</h4>
    
    
</dt>

<dd>

    
    <div class="description">
        <p>Get the list of fallback locales</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>lc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"><p>If empty or undefined, defaults to <code>this.locale</code></p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array.&lt;string></span>



    </dd>
</dl>


        

    
</dd>

        
            

<hr>
<dt>
    <h4 class="name" id="hasMessage"><span class="type-signature"></span>hasMessage(key [, lc] [, fallback])</h4>
    
    
</dt>

<dd>

    
    <div class="description">
        <p>Check if <code>key</code> is a message function for the locale</p>
<p><code>key</code> may be a <code>string</code> for functions at the root level, or <code>string[]</code> for
accessing hierarchical objects. If an exact match is not found and <code>fallback</code>
is true, the fallback locales are checked for the first match.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The key or keypath being sought</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>If empty or undefined, defaults to <code>this.locale</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fallback</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>If true, also checks fallback locales</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>



    </dd>
</dl>


        

    
</dd>

        
            

<hr>
<dt>
    <h4 class="name" id="hasObject"><span class="type-signature"></span>hasObject(key [, lc] [, fallback])</h4>
    
    
</dt>

<dd>

    
    <div class="description">
        <p>Check if <code>key</code> is a message object for the locale</p>
<p><code>key</code> may be a <code>string</code> for functions at the root level, or <code>string[]</code> for
accessing hierarchical objects. If an exact match is not found and <code>fallback</code>
is true, the fallback locales are checked for the first match.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Argument</th>
        

        
        <th>Default</th>
        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>
|

<span class="param-type">Array.&lt;string></span>



            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>The key or keypath being sought</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>lc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                </td>
            

            <td class="description last"><p>If empty or undefined, defaults to <code>this.locale</code></p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fallback</code></td>
            

            <td class="type">
            
                
<span class="param-type">boolean</span>



            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            
                <td class="default">
                
                    false
                
                </td>
            

            <td class="description last"><p>If true, also checks fallback locales</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>



    </dd>
</dl>


        

    
</dd>

        
            

<hr>
<dt>
    <h4 class="name" id="resolveLocale"><span class="type-signature"></span>resolveLocale(lc)</h4>
    
    
</dt>

<dd>

    
    <div class="description">
        <p>Resolve <code>lc</code> to the key of an available locale or <code>null</code>, allowing for
partial matches. For example, with an <code>en</code> locale defined, it will be
selected by <code>messages.defaultLocale = 'en-US'</code> and vice versa.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>lc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last"><p>Locale code</p></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>
|

<span class="param-type">null</span>



    </dd>
</dl>


        

    
</dd>

        
            

<hr>
<dt>
    <h4 class="name" id="setFallback"><span class="type-signature"></span>setFallback(lc, fallback)</h4>
    
    
</dt>

<dd>

    
    <div class="description">
        <p>Set the fallback locale or locales for <code>lc</code></p>
<p>To disable fallback for the locale, use <code>setFallback(lc, [])</code>.
To use the default fallback, use <code>setFallback(lc, null)</code>.</p>
    </div>
    

    

    

    
    
        <h5>Parameters:</h5>
        

<table class="params table table-striped">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>lc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>



            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>fallback</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array.&lt;string></span>
|

<span class="param-type">null</span>



            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>

    

    
<dl class="details">
    

	

	

	

    

    

    

    

	

	

	

	

	



	
	<dt class="tag-source method-doc-label method-doc-details-label">Source:</dt>
	<dd class="tag-source">
		<ul class="dummy">
			<li>
				<a href="messageformat_messages.js">messageformat/messages.js</a>
			</li>
		</ul>
	</dd>
	

	

	

	
</dl>


    

    

    

    

    

    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    <p>The Messages instance, to allow for chaining</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Messages">Messages</a></span>



    </dd>
</dl>


        

    
</dd>

        </dl>
    

    

    
</article>

</section>




		</div>
	</div>

	<div class="clearfix"></div>

	
		<div class="col-md-3">
			<div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
		</div>
	

</div>
</div>



<footer>


</footer>

<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>


<script>
$( function () {
	$( "[id*='$']" ).each( function () {
		var $this = $( this );

		$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
	} );

	$( ".page-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
		var $this = $( this );

		var example = $this.find( "code" );
		exampleText = example.html();
		var lang = /{@lang (.*?)}/.exec( exampleText );
		if ( lang && lang[1] ) {
			exampleText = exampleText.replace( lang[0], "" );
			example.html( exampleText );
			lang = lang[1];
		} else {
			var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
			lang = langClassMatch ? langClassMatch[1] : "javascript";
		}

		if ( lang ) {

			$this
			.addClass( "sunlight-highlight-" + lang )
			.addClass( "linenums" )
			.html( example.html() );

		}
	} );

	Sunlight.highlightAll( {
		lineNumbers : false,
		showMenu : true,
		enableDoclinks : true
	} );

	$.catchAnchorLinks( {
        navbarOffset: 10
	} );
	$( "#toc" ).toc( {
		anchorName  : function ( i, heading, prefix ) {
			return $( heading ).attr( "id" ) || ( prefix + i );
		},
		selectors   : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
		showAndHide : false,
		smoothScrolling: true
	} );

	$( "#main span[id^='toc']" ).addClass( "toc-shim" );
	$( '.dropdown-toggle' ).dropdown();

    $( "table" ).each( function () {
      var $this = $( this );
      $this.addClass('table');
    } );

} );
</script>



<!--Navigation and Symbol Display-->


<!--Google Analytics-->




</body>
</html>